package pers.archives.common.utils;


import pers.archives.common.constant.DateConstant;

import java.text.SimpleDateFormat;
import java.util.Date;

/*获取时间的工具类
 *@program:archives-parent
 *@author: 赵浩浩
 *@Time: 2020/10/1  18:35
 */
public class DateUtil {


    /**
     * 获取当前时间 Date 类型
     * @return
     */
    public static Date getCurrentTime(){
        SimpleDateFormat simpl = new SimpleDateFormat(DateConstant.DATE_FORM);
        Date date = new Date();
        String format = simpl.format(date);
        try {
            date = simpl.parse(format);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }
}
